package org.example.Vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
public class R {

    private Integer code;

    private String message;

    private Object data;

    public R(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }


    public static R ok(){
        return new R(200, "成功", null);
    }

    public static R ok(Object data){
        return new R(200,"成功",data);
    }

    public static R error(String message){
        return new R(500,message,null);
    }

}
